#ifndef _HANDLE_SET_H
#define	_HANDLE_SET_H

namespace NetIO
{

class Handle_Set
{
public:
	Handle_Set( )
	{
		reset( );
	}

	~Handle_Set( ) {}

	void reset( )
	{
		memset( &fd_set_, 0, sizeof( fd_set_ ) );
		maxfd_ = 0;
	}

	fd_set& get_fd_set( )
	{
		return fd_set_;
	}

	EventHandle maxfd( ) const
	{
		return maxfd_;
	}

	void set_handle( EventHandle handle )
	{
		if( maxfd_ < handle )
			maxfd_ = handle;

		FD_SET( handle, &fd_set_ );
	}

private:
	fd_set fd_set_;

	EventHandle maxfd_;
};

};

#endif //
